﻿/*
 * MapPaperUnit
 * 
 * initial implementation : 20.10.2008
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see Petra.Gis.License.txt
 */
using System;


namespace Petra.Gis.RenderingServices.PlanarBase 
{
  /// <summary>
  /// Definition of distance units to use in map.
  /// </summary>
  public partial class MapPaperUnit
  {

    /// <summary>
    /// represents an instance of a Map Paper Unit unit
    /// </summary>
    /// <param name="metersPerUnit">Number of meters per defined unit</param>
    /// <param name="name">Name</param>
    /// <param name="remarks">remarks name</param>
    public MapPaperUnit(double metersPerUnit, string name, string remarks)
    {
      MetersPerUnit = metersPerUnit;
      _name = name;
      Remarks = remarks;
    }

    #region DistanceUnit Members

    //private double _MetersPerUnit;

    /// <summary>
    /// Gets or sets the number of meters per <see cref="DistanceUnit"/>.
    /// </summary>
    public double MetersPerUnit
    { get; set; }





    private string _name;

    /// <summary>
    /// Name of Unit
    /// </summary>
    public string Name 
    {
      get { return _name; }
      set 
      {
        if (value == "")
          throw new ArgumentException("invalid unit name");
        _name = value; 
      }
    }





    //private string _remarks;

    /// <summary>
    /// remarks and notes about unit
    /// </summary>
    public string Remarks
    { get; set; }




    #endregion

    ///// <summary>
    ///// Checks whether the values of this instance is equal to the values of another instance.
    ///// Only parameters used for coordinate system are used for comparison.
    ///// Name, abbreviation, authority, alias and remarks are ignored in the comparison.
    ///// </summary>
    ///// <param name="obj"></param>
    ///// <returns>True if equal</returns>
    //public override bool EqualParams(object obj)
    //{
    //  if (!(obj is DistanceUnit))
    //    return false;
    //  return (obj as DistanceUnit).MetersPerUnit == this.MetersPerUnit;
    //}
  }
}